package scr 
{
	import flash.display.Bitmap;
	import flash.display.Loader;
	import flash.events.Event;
	import flash.events.IOErrorEvent;
	import flash.net.URLRequest;
	import flash.text.TextField;
	import ru.gosoplata.model.TmpModel;
	import ru.gosoplata.view.FooterView;
	import uicontrols.ButtonBase;
	/**
	 * ...
	 * @author a.orleansky
	 */
	public class ScreenWCClosed extends ScreenBase implements IScreen
	{
		private var txtinfo:TextField;
		
		private var _footer:FooterView = new FooterView();
		
		public function ScreenWCClosed() 
		{
			super("wc_closed");
		}
		
		override protected function init(e:Event):void 
		{
			super.init(e);
			
			addChild(_footer);
			
			loadBanner(TmpModel.IMG_FOLDER + "/blagorim_za_ispolzovanie/images/tualet_zanyat_title.png");
			
			var image:Loader = new Loader();
			var url:URLRequest = new URLRequest("img/blagorim_za_ispolzovanie/images/plane_big_platezi.png");
			image.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, function(e:IOErrorEvent):void { } );
			image.load(url);

			image.x = 150;
			image.y = 250;
			addChild(image);
			var icon:Bitmap = TmpModel.loadedImages.getBitmapDataByName("wc_closed");
			icon.x = image.x + 50;
			icon.y = image.y +100;
			addChild(icon);
			txtinfo = new TextField();
			txtinfo.x = icon.x + icon.width +5;
			txtinfo.y = icon.y + 20;
			txtinfo.embedFonts = true;
			txtinfo.defaultTextFormat = TmpModel.getTextFormat(30, 0x838383,true);
			txtinfo.width = 900;
			txtinfo.height = 300;
			txtinfo.multiline = true;
			txtinfo.selectable = false;
			addChild(txtinfo);
		}	
		
		override public function reDraw():void
		{
			_footer.reDraw();
			txtinfo.text = "К сожалению, в данный момент \n все кабинки заняты.";
		}
	}

}